home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
General
/
MM3Tp.sea Folder
/
Made by Marksman
/
Sources
/
u
/
My_basic_window.p
< prev
next >
Wrap
Text File
|
1994-01-16
|
8KB
|
344 lines
unit UMy_basic_window;
{ My_basic_window Handle this Window }
{ Copyright © 1994 George R. Cossey }
{
File name: My_basic_window
Function: Handle a Window
History: 1/16/94 Original by George Cossey
}
interface
uses
Printing,Folders,Sound,mmCommonMM_Demo,CommonMM_Demo;
{ ======================================================= }
{ ======================================================= }
procedure U_InitMy_basic_windowRec(theWS:My_basic_windowPRec);
{ Initialize us so all our routines can be activated }
procedure U_InitMy_basic_window;
{ Close our window }
procedure U_CloseMy_basic_window(theWS:My_basic_windowPRec);
{ Handle resizing scrollbars }
procedure U_ResizedMy_basic_window(theWS:My_basic_windowPRec;OldRect:Rect);
{ Our window was moved }
procedure U_MovedMy_basic_window(OldRect:Rect;whichWindow:WindowPtr);
{ Update our window, someone uncovered a part of us }
procedure U_UpdateMy_basic_window(theWS:My_basic_windowPRec);
{ Open our window and draw everything }
procedure U_OpenMy_basic_window(theWS:My_basic_windowPRec);
{ Handle activation of our window }
procedure U_ActivateMy_basic_window(theWS:My_basic_windowPRec;Do_An_Activate:Boolean);
{ Handle action to our window, like controls }
procedure U_DoButtonMy_basic_window(theWS:My_basic_windowPRec;RefCon:longint;theControl:ControlHandle;var UnHiliteValue:integer);
{ Handle a checkbox being pressed }
procedure U_DoCheckboxMy_basic_window(theWS:My_basic_windowPRec;theControl:ControlHandle;var NewValue:integer);
{ Allow for special handling of scrollbars }
procedure U_ScrollMy_basic_window(theWS:My_basic_windowPRec;var RefCon:longint;code:integer;myPt:Point);
{ Handle any special window events }
procedure U_DoEventMy_basic_window(theWS:My_basic_windowPRec;var myEvent:EventRecord);
{ ======================================================= }
{ ======================================================= }
implementation
{ ======================================================= }
{ ======================================================= }
procedure U_InitMy_basic_windowRec(theWS:My_basic_windowPRec);
begin
end;
{ ======================================================= }
{ Routine: U_InitMy_basic_window }
{ Purpose: Initialize our window data to not in use yet }
procedure U_InitMy_basic_window;
begin
end;
{ ======================================================= }
{ Routine: U_CloseMy_basic_window }
{ Purpose: Close out the window }
procedure U_CloseMy_basic_window(theWS:My_basic_windowPRec);
begin
end;
{ ======================================================= }
{ Routine: U_ResizedMy_basic_window }
{ Purpose: We were resized or zoomed, update the scrolling scrollbars }
{ OldRect is the size of the window before the resize }
procedure U_ResizedMy_basic_window(theWS:My_basic_windowPRec;OldRect:Rect);
begin
end;
{ ======================================================= }
{ Routine: U_MovedMy_basic_window }
{ Purpose: We were moved, possibly to another screen and screen depth }
{ OldRect is the size of the window before the resize }
procedure U_MovedMy_basic_window(OldRect:Rect;whichWindow:WindowPtr);
begin
end;
{ ======================================================= }
{ Routine: U_UpDateMy_basic_window }
{ Purpose: Update our window }
{ User can place code before or after the DrawControls }
procedure U_UpdateMy_basic_window(theWS:My_basic_windowPRec);
begin
DrawControls(theWS^.theWindow); { Draw all the controls }
end;
{ ======================================================= }
{ Routine: U_OpenMy_basic_window }
{ Purpose: Open our window }
procedure U_OpenMy_basic_window(theWS:My_basic_windowPRec);
begin
if ((theWS <> nil) and (theWS^.theWindow <> nil)) then { See if opened OK }
begin
end;
end;
{ ======================================================= }
{ Routine: U_ActivateMy_basic_window }
{ Purpose: We activated or deactivated }
procedure U_ActivateMy_basic_window(theWS:My_basic_windowPRec;Do_An_Activate:Boolean);
begin
if (Do_An_Activate) then { Handle the activate }
begin
end
else
begin
end;
end;
{ ======================================================= }
{ Routine: U_DoButtonMy_basic_window }
{ Purpose: Handle extra buttons in our window }
{ RefCon = The RefCon of the button that was pressed }
{ theControl = The ControlHandle of the button that was pressed }
{ UnHiliteValue = 0 for unhilite, we can change that }
procedure U_DoButtonMy_basic_window(theWS:My_basic_windowPRec;RefCon:longint;theControl:ControlHandle;var UnHiliteValue:integer);
var
theSelection:integer; { For palette and popup selections }
begin
case (RefCon) of { Select correct button }
-1:begin end;
ResC_Button: { Button, Button }
begin
end;
ResC_Icon: { Icon button, Icon }
begin
end;
ResC_Sicn: { Sicn button, Sicn }
begin
end;
ResC_Picture: { Picture button, Picture }
begin
end;
ResC_Rect_hotspot2: { HotSpot, Rect hotspot2 }
begin
end;
ResC_Tool_palette: { Palette, Tool palette }
begin
theSelection := GetCtlValue(theWS^.Ctrl_Tool_palette);{ Get the palette value, 0xrrcc, rr is row, cc is column }
theWS^.Value_Tool_palette := theSelection; { Get the palette value }
case (theSelection) of { Select correct item }
-1:begin end;
257: { Row 1, Column 1 }
begin
end;
258: { Row 1, Column 2 }
begin
end;
513: { Row 2, Column 1 }
begin
end;
514: { Row 2, Column 2 }
begin
end;
769: { Row 3, Column 1 }
begin
end;
770: { Row 3, Column 2 }
begin
end;
1025: { Row 4, Column 1 }
begin
end;
1026: { Row 4, Column 2 }
begin
end;
1281: { Row 5, Column 1 }
begin
end;
1282: { Row 5, Column 2 }
begin
end;
1537: { Row 6, Column 1 }
begin
end;
1538: { Row 6, Column 2 }
begin
end;
1793: { Row 7, Column 1 }
begin
end;
1794: { Row 7, Column 2 }
begin
end;
2049: { Row 8, Column 1 }
begin
end;
2050: { Row 8, Column 2 }
begin
end;
2305: { Row 9, Column 1 }
begin
end;
2306: { Row 9, Column 2 }
begin
end;
2561: { Row 10, Column 1 }
begin
end;
2562: { Row 10, Column 2 }
begin
end;
otherwise { allow other buttons, trap for debug }
begin
end;
end; { end of switch }
end;
otherwise { allow other buttons, trap for debug }
begin
end;
end; { end of switch }
end;
{ ======================================================= }
{ Routine: U_DoCheckBoxMy_basic_window }
{ Purpose: Handle ckboxes and radios in our window }
procedure U_DoCheckboxMy_basic_window(theWS:My_basic_windowPRec;theControl:ControlHandle;var NewValue:integer);
var
RefCon:longint; { RefCon for controls }
begin
RefCon := GetCRefCon(theControl); { get control refcon }
case (RefCon) of { Select correct button }
-1:begin end;
ResC_Checkbox: { Checkbox, Checkbox }
begin
end;
otherwise { allow other buttons, trap for debug }
begin
end;
end; { end of switch }
end;
{ ======================================================= }
{ Routine: U_ScrollMy_basic_window }
{ Purpose: Special handling of scrollbars }
{ Return RefCon as 0 to inhibit standard routine from handling it }
procedure U_ScrollMy_basic_window(theWS:My_basic_windowPRec;var RefCon:longint;code:integer;myPt:Point);
begin
case (RefCon) of { Select correct button }
-1:begin end;
ResC_Scroll_bar: { ScrollBar, Scroll bar }
begin
{ HandleWScrollBar(myPt,code,1,10,theControl); x code,Inc,PageInc,handle x }
theWS^.Value_Scroll_bar := GetCtlValue(theWS^.Ctrl_Scroll_bar);{ Get the scrollbar value }
end;
otherwise { allow other buttons, trap for debug }
begin
end;
end; { end of switch }
end;
{ ======================================================= }
{ Routine: U_DoEventMy_basic_window }
{ Purpose: Handle any special window events }
procedure U_DoEventMy_basic_window(theWS:My_basic_windowPRec;var myEvent:EventRecord);
begin
end;
{ ======================================================= }
{ ======================================================= }
end.